package cn.mw.cmdb.exception;

import cn.mw.components.mongodb.exception.BusinessException;

import java.util.ArrayList;
import java.util.List;

public class CompoundException extends BusinessException {
    private List<BusinessException> exceptionList = new ArrayList<>();

    public CompoundException(){
        super("compound-error");
    }

    public void addInstanceValidateException(BusinessException businessException){
        exceptionList.add(businessException);
    }

    public List<BusinessException> getExceptionList() {
        return exceptionList;
    }

    public boolean hasException(){
        return exceptionList.size() != 0;
    }
}
